﻿@*
	For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
	Layout = "_Layout";
}

<body class="login-bg">
	<div class="login layui-anim layui-anim-up">
		<div class="message">管理登录</div>
		<div id="darkbannerwrap"></div>
		<form method="post" class="layui-form">
			<input name="UserName" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
			<hr class="hr15">
			<input name="Pwd" lay-verify="required" placeholder="密码" type="password" class="layui-input">
			<hr class="hr15">
			<input value="登录" lay-submit lay-filter="login" style="width: 100%;" id="tijiao" type="submit">
			<hr class="hr20">
		</form>
	</div>
	<script>
$(function  () {
            layui.use(['form','jquery'], function(){
              var form = layui.form;
    var $=layui.$;
              // layer.msg('玩命卖萌中', function(){
              //   //关闭后的操作
              //   });
              //监听提交
              form.on('submit(login)', function(data){
  $.ajax({
		type:"post",
		url:'@Url.Action("Login")',
		data:data.field,
	  success: function (result)
	  {
			if(result.state!="OK"){
				layer.msg(result.msg,function(){});
			}else{
				location.href='@Url.Action("Index","Admin")';
			}
		}
		});
                return false;

            });
        })
})
	</script>

</body>
